home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group94b.txt
/
000000_icon-group-sender _Thu Aug 18 20:53:54 1994.msg
next >
Wrap
Internet Message Format
|
1995-02-09
|
2KB
Received: by cheltenham.cs.arizona.edu; Fri, 19 Aug 1994 05:34:01 MST
To: icon-group-l@cs.arizona.edu
Date: 18 Aug 1994 20:53:54 -0700
From: dave@cs.arizona.edu (Dave Schaumann)
Message-Id: <331aci$gn3@baskerville.CS.Arizona.EDU>
Organization: University of Arizona CS Department, Tucson AZ
Sender: icon-group-request@cs.arizona.edu
Subject: A small but (hopefully) helpful utility
Errors-To: icon-group-errors@cs.arizona.edu
Today, I decided to start my own personl library of icon routines.
This change introduced a bug: all of a sudden, I was getting an
"undeclared identifier" error on a call to one of my library
routines. After much checking of environment variables and
directory contents, it occurred to me that my library code might
just be shadowed by an "official" library file.
Sure enough, that was the case. So I wrote the appended little
program to check where a particular library file is. Usage is
wil <name list>
(wil == Which Icon Library). Names should be as they appear in
the link statement (ie, no trailing .u1, .u2, or .icn). The
program will then print out where it finds each name (including
multiple occurrences.
Bugs: this will break on file names with white spaces in them,
and is Un*x-specific. Feel free to let me know if you
find any other problems...
$define SPACES ' \t\n\r\v'
procedure search( path, names )
local f, name
if path[-1] ~== "/" then path ||:= "/"
every name := !names do {
if f := open(path || name || ".u1", "r") then {
write( path || name )
close(f)
}
}
return
end
procedure main( args )
local IPATH
IPATH := \getenv("IPATH") |
stop( "Can't read IPATH environment variable" )
IPATH ? {
while tab(upto(~SPACES)) do
search( tab(many(~SPACES)), args )
}
search( ".", args )
end